A -calculus Speciication of Prolog
نویسنده
چکیده
A clear and modular speciication of Prolog using the-calculus is presented in this paper. Prolog goals are represented as-calculus processes, and Prolog predicate deenitions are translated into-calculus agent deenitions. Prolog's depth-rst left-right control strategy as well as the cut control operator are modeled by the synchronized communication among processes, which is similar in spirit to continuation-passing style implementation of Prolog. Prolog terms are represented by persistent processes, while logical variables are modeled by complex processes with channels that, at various times, can be written, read, and reset. Both uniications with and without backtracking are speciied by-calculus agent deenitions. A smooth merging of the speciication for control and the speciication for uniication gives a full speciication for much of Prolog. Some related and further works are also discussed. 1 Introduction Prolog is a simple, powerful and eecient programming language, but its depth-rst left-right control as well as the control operator cut (!) and its lack of the occurs check destroys the declarative reading of Prolog programs. For example, a left recursive clause will cause an innnite computation while a right recursive clause with same logic reading will terminate the computation. Hence, logic does not provide a simple and formal semantics for Prolog. In Ros92a] Ross provided an interesting speciication of Prolog control by mapping it into processes in the concurrent speciication language CCS Mil89]. In this paper, we develop and extend this approach signiicantly by using the-calculus, a richer concurrent speciication language. We are not only able to specify Prolog's control primitives but also its correct interaction with Prolog's uniication, including the lack of the occur-check and the construction of circular terms. The-calculus MPW92a, MPW92b, Mil91] is a calculus for modeling concurrent systems with evolving communication structure. It has been proven very powerful in modeling functional programming languagessMil90b] and object-oriented programming languagessWal90]. In this paper, we will introduce a clear and modular speciication for Prolog using the-calculus. The speciication is modular in the sense that the Prolog control part and uniication are speciied separately, but can be merged together smoothly to form a full speciication for Prolog. In fact, part of the motivation behind this paper was to understand how successfully the-calculus could be used to specify the operational semantics of a non-trivial programming language, in this case Prolog. As we hope it will be clear from this paper, the-calculus, along with a sorting discipline proposed for it, does indeed provide …
منابع مشابه
Scdbr: an Automated Reasoner for Database Updates (extended Abstract)
In this paper we describe SCDBR, a system that automates reasoning with speciications of database updates written in the situation calculus, a rst{order language originally proposed by John McCarthy for reasoning about actions and change. The speciications are expected to be given according to Ray Reiter's solution to the frame problem. SCDBR is written in PROLOG, and among other features is ab...
متن کاملScdbr: an Automated Reasoner for Speciications of Database Updates
In this paper we describe SCDBR, a system that is able to reason automatically from speciications of database updates written in the situation calculus, a rst{order language originally proposed by John McCarthy for reasoning about actions and change. The speciications handled by the system are written in the formalism proposed by Ray Reiter for solving the frame problem that appears when one ex...
متن کاملThe Mathematics of Set Predicates in Prolog
We provide a logical speciication of set predicates ndall and bagof of Prolog. The speciication is given in proof theoretic terms, and pertains to any SLD{resolution based language. The order dependent aspects, relevant for languages embodying a sequential proof search strategy (possibly with side eeects), can be added in an orthogonal way. The speciication also allows us to prove that bagof ca...
متن کاملThe Oyster-Clam System
O Y S T ER Hor88] is an interactive proof editor closely based on the Cornell NuPRL system, but implemented in Prolog. The object-level logic is a version of Martin-LL of type theory (a higher order constructive logic including induction) in a sequent-calculus formulation. Proofs are constructed in a top-down fashion by application of the rules of inference. Notational deenitions and libraries ...
متن کاملExtending the Qualitative Trajectory Calculus Based on the Concept of Accessibility of Moving Objects in the Paths
Qualitative spatial representation and reasoning are among the important capabilities in intelligent geospatial information system development. Although a large contribution to the study of moving objects has been attributed to the quantitative use and analysis of data, such calculations are ineffective when there is little inaccurate data on position and geometry or when explicitly explaining ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 1994